package com.heima.wemedia.controller.v1;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmNewsPageReqDTO;
import com.heima.wemedia.service.WmNewsService;
import com.heima.model.common.dtos.PageRequestDTO;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmAttentionFansDto;
import com.heima.model.wemedia.dtos.WmFansStatisticsDto;
import com.heima.model.wemedia.dtos.WmReadCountByDateDTO;
import com.heima.wemedia.service.WmUserFansService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "粉丝管理API",tags = "粉丝管理API")
@RestController
@RequestMapping("/api/v1/user_fans")
public class WmUserFansController {

    @Autowired
    private WmUserFansService wmUserFansService;



    @PostMapping("/list")
    @ApiOperation("查询粉丝列表")
    public ResponseResult findArticle(@RequestBody PageRequestDTO pageRequestDTO) {
        return wmUserFansService.getFansList(pageRequestDTO);
    }

    @PostMapping("/change_follow_state")
    @ApiOperation("关注或者取消粉丝")
    public ResponseResult attention(@RequestBody WmAttentionFansDto wmAttentionFansDto) {
        return wmUserFansService.attentionFans(wmAttentionFansDto);
    }

    //    http://localhost:8282/wemedia/MEDIA/wemedia/api/v1/user_fans/fans_portrait
    @GetMapping("/fans_portrait")
    @ApiOperation("粉丝画像")
    public ResponseResult portrayal() {
        return wmUserFansService.fansPortrayal();
    }
}

